package com.example.netty.实现客户端与服务端信息收发;

import com.example.netty.encode.attr.Attributes;
import io.netty.channel.Channel;

/** 简单登录工具类
 * @author liupk
 * @date 2018/11/7
 */
public class LoginUtil {
    
    public static void maskLogin(Channel channel){
        channel.attr(Attributes.LOGIN).set(true);
    }
    
    public static boolean hasLogin(Channel channel){
        Boolean aBoolean = channel.attr(Attributes.LOGIN).get();
        return aBoolean != null && aBoolean.equals(Boolean.TRUE);
    }
}